# 12. 分解连续正整数组合
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.on('line', (line) => {
const n = parseInt(line);
for(let m=2; m*(1+m)/2<=n; m++) {
if((n - m*(m-1)/2)%m === 0) {
let x = (n - m*(m-1)/2)/m;
let res = `${n}=`;
for(let i=0; i<m; i++) {
res += (x + i).toString();
if (i < m-1) {
res += '+';
}
}
console.log(res);
return;
}
}
console.log('N');
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24